<template>
    <el-dialog
            title="数据集信息"
            :visible.sync="modelInfoVisible"
            :close-on-click-modal="false"
            width="40%"
            v-dialogDrag>
        <div style="padding-left: 0.5%;padding-top:1%">
            <p>用户ID：{{this.infoData.userid}}</p>
            <p>数据集名称：{{this.infoData.name}}</p>
            <p>数据集创建时间：{{this.infoData.createtime}}</p>
            <p>数据集最后修改时间：{{this.infoData.lastmodifytime}}</p>
            <p>是否为空间数据：{{this.infoData.isspatialdata}}</p>
            <p>数据类型：{{this.infoData.datatype}}</p>
            <p>存储类型：{{this.infoData.storetype}}</p>
            <p>数据集ID：{{this.infoData.id}}</p>
        </div>
    </el-dialog>
</template>

<script>
    export default {
        name: "modelInfoDialog",
        data() {
            return {
                modelInfoVisible: false,
                url: '',
                infoData: {},
            }
        },
        methods: {
            getModelInfo() {
                let that = this;
                this.infoData = {};
                this.$axios.get(that.url).then(res => {
                    that.infoData = res.body;
                }).catch(function (error) {
                    console.log(error);
                    that.$message({
                        type: 'warning',
                        message: '模型数据集获取失败！'
                    })
                })
            }
        },
        created() {
            let that = this;
            this.$Bus.$on('personalDataInfo', res => {
                that.url = res.url;
                that.modelInfoVisible = res.visible;
                that.getModelInfo();
            })
        }
    }
</script>

<style>
    .el-dialog__body {
        max-height: 600px;
        overflow: auto;
    }
</style>